package com.itheima.array;
//数据查找

import java.util.Scanner;

public class Array03 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] arr = {28, 45, 41, 28, 69};
        int index = -1;
        System.out.println("请输入一个数字进行查找");
        int num = sc.nextInt();
        for (int i = 0; i < arr.length; i++) {


            if (arr[i] == num) {
                index = i;
                System.out.println(index);

            }

        }


    }

    public static boolean compare(int a, int b) {
        if (a == b) {
            return true;
        } else return false;
    }
}